<?php

class BolaoNewsPeer extends BaseBolaoNewsPeer
{
  static public function getLastNews($max = 10)
  {
    $criteria = BolaoNewsPeer::getLatestNewsCriteria();
    $criteria->setLimit($max);

    return BolaoNewsPeer::doSelect($criteria);
  }

  public static function getLatestNewsCriteria()
  {
    $criteria = new Criteria();
    $criteria->addDescendingOrderByColumn(BolaoNewsPeer::CREATED_AT);
    return $criteria;
  }
}
